package com.help10000.rms.mvp.presenter

import com.amir.common.api.CustomObserver
import com.amir.common.beans.WalletEntity
import com.amir.common.mvp.model.Model
import com.amir.common.mvp.presenter.BasePresenter
import com.amir.common.utils.Constant
import com.amir.common.utils.SPUtils
import com.help10000.rms.mvp.view.WalletView

class WalletPresenter(view: WalletView) : BasePresenter<WalletView>(view) {
    fun getWallData() {
        val AccessToken = SPUtils.getString(Constant.AccessToken)
        val wallData = Model.getServer().getWallData(AccessToken)
        Model.getObservable(wallData, object : CustomObserver<WalletEntity>(mvpView) {

            override fun success(t: WalletEntity) {
                mvpView?.walletDataSuccess(t.data)
            }
        })
    }
}